<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <select name="" @change="getcity($event)">
            <option value="" selected disabled>请选择</option>
            <option v-for="item in pro">{{item.name}}</option>
        </select>
        <select name="" id="" @change="getarea($event)">
           <option value="" selected disabled>请选择</option>
           <option v-for="item in city">{{item.name}}</option>
        </select>
        <select name="" id="">
           <option value="" selected disabled>请选择</option>
           <option v-for="item in area">{{item}}</option>
        </select>
    </div>
    <script src="./js/data.js"></script>
    <script src="./js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                pro: data,
                city: [],
                area: []
            },
            methods: {
                getcity(e) {
                    //console.log(this.pro)
                    this.pro.forEach((i) => {
                        if (i.name == e.target.value) {
                            i.city.forEach((item) => {
                                this.city.push(item)
                            })
                        }
                    })
                },
                getarea(e) {
                    //console.log(this.pro)
                    this.city.forEach((i) => {
                        if (i.name == e.target.value) {
                            i.area.forEach((item) => {
                                console.log(item)
                                this.area.push(item)
                            })
                        }
                    })
                }
            }
        })
    </script>
</body>

</html>